import Vue from "vue";
import VueRouter from "vue-router";
// import Home from "../views/Home.vue";
import appLayout from "@/components/Layout/app";
// import articleList from "@/views/app/overview";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: appLayout,
    redirect: '/list',
    // component: () => import('@/views/app/overview'),
    meta: { title: '博客主页'},
    children: [
      {
        path: 'list',
        name: 'list',
        // component: articleList,
        component: () => import('@/views/app/overview'),
        meta: { title: '博客主页'}
      },
      {
        path: 'articleDetails',
        rootModule: 'app',
        name: 'articleDetails',
        component: () => import('@/views/app/articleDetails'),
        meta: { title: '文章详情', requireLogin: false, authorizedRoles: [] },
        hidden: true
      }
    ]
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
